//
//  YHOptionTitleSwitchTableViewCell.m
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/29.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHOptionTitleSwitchTableViewCell.h"

@implementation YHOptionTitleSwitchTableViewCell


-(void)yh_commonInit{
    [super yh_commonInit];
    
    self.cellSwitch = [UISwitch new];
    [self.cellSwitch addTarget:self action:@selector(switchAction) forControlEvents:UIControlEventValueChanged];
    [self.cellOptionContentView addSubview:self.cellSwitch];
    [self.cellSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.cellOptionContentView);
        make.left.equalTo(self.cellOptionContentView);
    }];
}

- (void)switchAction{
    if(self.switchChangeBlock){
        self.switchChangeBlock(self.cellSwitch.on);
    }
}

@end
